from tkinter import *
class GridManagerDemo:
    def __init__(self):
        window = Tk()
        window.title("grid manager demo")

        message = Message(window,text='this message widget occupies three row and two columns')
        message.grid(row=1,column = 1,rowspan = 3,columnspan=2)
        Label(window,text='first name:').grid(row=1,column = 3)
        Entry(window).grid(row=1,column = 4,padx=5,pady=5)
        Label(window,text='last name:').grid(row=2,column=3)
        Entry(window).grid(row=2,column=4)
        Button(window,text='getName').grid(row=3,padx=5,pady=5,column=4,sticky =NE)
        window.mainloop()

GridManagerDemo()
